var tree;
var setting = {
		view: {
			dblClickExpand: false,
			showLine: true
		},
		async : {
			enable : true,
			url : "admin/treenode/tree-node!ztree",
			autoParam : ["id=bean.id"],
			otherParam:{"search":"s"}
		   // dataFilter: filter
		},
		callback : {			
			onClick : nodeClick
		}

	};
var zNodes = [ {
	name : "生产辅助管理系统",
	open : true,
	children : [ {
		name:"月统计快报",
		open:true,
		children: [ {
			name : "我的报表",
			href : "armmonthreporter/arm-month-product-reporter!pager"
		}]
	} ,
	{
		name:"生产系统",
		open:true,
		isParent:true,
		id:"40288182323777c201323842d08d0003"			
	},
	{
		name:"产品管理",
		open:true,
		isParent:true,
		id:"008a813b18bbdeb90118bbdf362f0001"
	},
	{
		name:"查看月报",
		open:true,
		isParent:false,
		href:"reporter/finished/viewall"
	},
	{
	    name:'产品台帐',
	    open:true,
	    isParent:false,
	    href:'product/product-count'
	}
	
	]
} ];
$(function() {	
	tree= $.fn.zTree.init($("#mytree"), setting, zNodes);	

});
function desktop(){
	doGet("desktop");
}
function nodeClick(event, treeId, treeNode) {
	if(treeNode.isParent){
		var zTree = $.fn.zTree.getZTreeObj("mytree");
		zTree.expandNode(treeNode);
		return;
	}
	doGet(treeNode.href);
}
function logout(url){
	if(window.opener) window.opener = null;
	//if(window.parent)window.parent=null;
	window.open(url, "_self");
}